home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / RESOURCES / CH5 / EMAGA5 / common / server / audio.cs next >
Text File  |  2005-11-23  |  919b  |  24 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine 
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5.  
  6. //-----------------------------------------------------------------------------
  7.  
  8. function ServerPlay2D(%profile)
  9. {
  10.    // Play the given sound profile on every client.
  11.    // The sounds will be transmitted as an event, not attached to any object.
  12.    for(%idx = 0; %idx < ClientGroup.getCount(); %idx++)
  13.       ClientGroup.getObject(%idx).play2D(%profile);
  14. }
  15.  
  16. function ServerPlay3D(%profile,%transform)
  17. {
  18.    // Play the given sound profile at the given position on every client
  19.    // The sound will be transmitted as an event, not attached to any object.
  20.    for(%idx = 0; %idx < ClientGroup.getCount(); %idx++)
  21.       ClientGroup.getObject(%idx).play3D(%profile,%transform);
  22. }
  23.  
  24.